//
//  PKBaseViewController.m
//  PianKe
//
//  Created by mingtao on 15/9/25.
//  Copyright (c) 2015年 mingtao. All rights reserved.
//

#import "PKBaseViewController.h"

@interface PKBaseViewController ()

//左侧按钮
@property(nonatomic,strong)UIButton *leftButton;

@end

@implementation PKBaseViewController

-(UIView *)topView
{
    if (!_topView) {
        _topView = [[UIView alloc]initWithFrame:CGRectMake(0, 20, WIHES, 50)];
        
      //  _topView.backgroundColor = [UIColor colorWithRed:0.847 green:1.000 blue:0.088 alpha:1.000];
        _leftButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        
        _leftButton.frame = CGRectMake(5, 10, 30, 30);
        
        [_leftButton setTitle:@"三" forState:(UIControlStateNormal)];
        
        _leftButton.backgroundColor = [UIColor colorWithRed:0.871 green:1.000 blue:0.622 alpha:1.000];
        
        [_leftButton addTarget:self action:@selector(changeViewFrame:) forControlEvents:(UIControlEventTouchUpInside)];
        
        [_topView addSubview:_leftButton];
        
        [_topView addSubview:self.titleLable];
        
#warning 周期
        [self.view addSubview:_topView];
    }
    return _topView;
}

-(UILabel *)titleLable
{
    if (!_titleLable) {
        _titleLable = [[UILabel alloc]initWithFrame:CGRectMake(50, 10, 100, 30)];
        
    }
    return _titleLable;
    
}


-(void)changeViewFrame:(UIButton *)sender
{
    //切换视图的位置
    [self.changeFrameVC changgeFrame];
    
    

}









- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    NSLog(@"%@",self.topView);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
